#include <iostream>
#include <string>
#include <vector>
using namespace std;

int fact(int My_number) //函数的声明及定义
{
  int My_answer = 1;
  for (; My_number > 1; My_number--) {
    My_answer *= My_number;
  }
  return My_answer; //注意int的可表示范围，超出范围就会出错咯~
}
int main() {
  cout << "请输入需要计算阶乘的数字:";
  int Given_number;
  cin >> Given_number;
  int Out_put = fact(Given_number); //函数的调用部分
  cout << Given_number << "的阶乘结果为：" << Out_put << endl;
  return 0;
}